import { NgModule,SkipSelf,Optional } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CoreModule } from '../core/core.module';
import { RouterModule }   from '@angular/router';
import { FormsModule }   from '@angular/forms';
import { MatButtonModule,MatAutocompleteModule,MatInputModule} from '@angular/material';
import { KeywordComponent } from './keyword.component';

import { DragulaModule } from 'ng2-dragula';
import { BsDatepickerModule } from 'ngx-bootstrap';
import { PublicModule } from '../public/public.module';
import { TreeTableModule } from '../public/treetable/treetable';
import { TrialComponent } from './trial/trial.component';
import { UnreviewedComponent } from './unreviewed/unreviewed.component';
import { TrialAddComponent } from './trial/trial-add/trial-add.component';
import { TrialButtonComponent } from './trial/trial-button/trial-button.component';
import { TrialDeleteComponent } from './trial/trial-delete/trial-delete.component';
import { TrialDetailComponent } from './trial/trial-detail/trial-detail.component';
import { TrialEditComponent } from './trial/trial-edit/trial-edit.component';
import { TrialExportComponent } from './trial/trial-export/trial-export.component';
import { TrialTableComponent } from './trial/trial-table/trial-table.component';
import { TrialTablesComponent } from './trial/trial-tables/trial-tables.component';
import { TrialImportComponent } from './trial/trial-import/trial-import.component';
import { FileUploadModule } from 'ng2-file-upload';
import { TrialSynonymComponent } from './trial/trial-synonym/trial-synonym.component';
import { TrialSynonymAutocomplateComponent } from './trial/trial-synonym/trial-synonym-autocomplate/trial-synonym-autocomplate.component';
import { SidebarModule } from '../sidebar/sidebar.module';
import { TrialDownloadComponent } from './trial/trial-download/trial-download.component';

@NgModule({
  imports: [
    CommonModule,
    CoreModule,
    RouterModule,
    FormsModule,
    DragulaModule,
    PublicModule,
    MatButtonModule,
    MatAutocompleteModule,
    MatInputModule,
    TreeTableModule,
    FileUploadModule,
    BsDatepickerModule.forRoot(),
    SidebarModule
  ],
  declarations: [
    KeywordComponent,
    TrialComponent,
    UnreviewedComponent,
    TrialAddComponent,
    TrialButtonComponent,
    TrialDeleteComponent,
    TrialDetailComponent,
    TrialEditComponent,
    TrialExportComponent,
    TrialTableComponent,
    TrialTablesComponent,
    TrialImportComponent,
    TrialSynonymComponent,
    TrialSynonymAutocomplateComponent,
    TrialDownloadComponent
  ],
})
export class KeywordModule { 
  constructor(@Optional() @SkipSelf() parent:KeywordModule){
    if(parent){
      throw new Error('Keyword模块已经加载，不要再次加载')
    }
  }
}
